interface Person1 {
  id: number;
  name: string;
  age: number;
  friends: string[];
}

class Student implements Person1 {
  id: number;
  name: string;
  age: number;
  friends: string[];

  constructor(id: number, name: string, age: number, friends: string[]) {
    this.age = age;
    this.id = id;
    this.name = name;
    this.friends = friends;
  }

  getFrends():string {
    let friends = "";
    this.friends.forEach((value) => {
      friends += value + " ";
    })
    return friends;
  }
}

const student = new Student(1,"haha",20,["xiaoming","xiaohong"]);
console.log(student.getFrends());
 